package component;

import javax.swing.*;
import java.awt.*;

/**
 * @author zhongwen
 * @description 带背景图片的JPannel
 * @date 2021-12-08 21:03
 */
public class BackGroundJPanel extends JPanel {
    private Image bgImage;
    public BackGroundJPanel(Image bgImage){
        this.bgImage = bgImage;
    }
    @Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(bgImage, 0, 0,this.getWidth(),this.getHeight(), null);
    }
}
